package com.haojin.contacs;

import java.util.Arrays;
public class ArrayTools {
public static void main(String[] args){
	int arr1[] = new int[]{1,2,3,4};
	int arr2[] = new int[]{1,3,2,4};
	boolean isEquals = Arrays.equals(arr1,arr2);
	System.out.println(isEquals);
	System.out.println(Arrays.toString(arr1));
	System.out.println(Arrays.toString(arr2));
	Arrays.fill((arr1), 100);
	System.out.println(Arrays.toString(arr1));
	Arrays.sort(arr2);
	System.out.println(Arrays.toString(arr2));
	int search = Arrays.binarySearch(arr2, 4);
	if(search > 0){
		System.out.println("在第"+ (search + 1) +"的位置。");
	}
	else System.out.println("未找到。");
	System.out.println();
}
}
